import { useSelector } from "react-redux"
import type { ROOTSTATE } from "../store"
import { Empty } from "antd"

type Props = {
    children:React.ReactNode
}
export const RouterAuth = ({children}:Props)=>{
    const {isLogin} = useSelector((state:ROOTSTATE)=>state.userStore)
    return isLogin ? children : <Empty />
}